package com.wuhan.template.module.home.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/5/12 0012.
 */
public class ZhiBoPageAdapter extends FragmentPagerAdapter{

    private Context context;
    private  List<Fragment> fragments;

    public ZhiBoPageAdapter(FragmentManager fm,List<Fragment> fragments) {
        super(fm);
        //this.context = context;
        this.fragments = fragments;
    }


    @Override
    public int getCount() {
        return fragments==null?0:fragments.size();
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }


    private String [] titles= {"电视","广播"};

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
